Annotations for Prolog - A Concept and Runtime Handling

نویسنده

  • Marija Kulas
چکیده

A concept of annotations for rendering procedural aspects of Prolog is presented, built around wellknown procedural concepts of Standard Prolog. Annotations describe properties of predicates. Such properties can be pre or post conditions, which must hold true when a predicate is called or exited, respectively. Our concept transcends pre/post conditions: we introduce two more kinds of annotations, fail and redo annotations, hence incorporating a whole model of Prolog execution into our language. This enables natural rendering of many procedural properties of Prolog which cannot be expressed with only pre/post conditions. There are four more novelties in our approach. First, any annotation can be “narrowed down” to a subset of calls, via templates and contexts, giving much more flexible assertions. Notably the novel idea of calling context adds significant expressive power, as a bridge towards program-point assertions. The annotations are defined simply as Prolog goals, making them fully parametric and therefore very comfortable for debugging. Finally, the annotations are applied via a general kind of matching instead of unification, enabling the use of local variables. All examples presented here are actual runs of our system Nope, which is a Prolog module.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Compiling Constraint Handling Rules into Prolog with Attributed Variables

We introduce the most recent and advanced implementation of constraint handling rules (CHR) in a logic programming language, which improves both on previous implementations (in terms of completeness , exibility and eeciency) and on the principles that should guide such a Prolog implementation consisting of a runtime system and a compiler. The runtime system utilizes attributed variables for the...

متن کامل

Intelligent search strategies based on adaptive Constraint Handling Rules

The most advanced implementation of adaptive constraint processing with Constraint Handling Rules (CHR) allows the application of intelligent search strategies to solve Constraint Satisfaction Problems (CSP). This presentation compares an improved version of conflict-directed backjumping and two variants of dynamic backtracking with respect to chronological backtracking on some of the AIM insta...

متن کامل

Debugging Prolog Using Annotations

We present an annotation language well-suited for rendering aspects of Prolog execution. Our annotations are special Prolog goals that act as executable comments, performing debugging at run-time. No restrictions are placed upon the object language , the concern being veriication of (full) Standard Prolog programs. Here we discuss the merits of the annotations for Prolog debugging. All the exam...

متن کامل

Constraintpropagation in Qualitative Modelling: Domain Variables Improve Diagnostic Eeciency

This paper shows how a speciic constraint propagation technique-namely domain variables-can speed up qualitative diagnosis considerably. We are using the KARDIO system, a qualitative simulation model of the electrical activity of the heart, to exemplify our points. Furthermore we describe how the domain handling mechanism itself can be implemented in PROLOG eeciently. For a class of application...

متن کامل

Adding Constraint Handling Rules to Curry

This paper proposes an integration of Constraint Handling Rules (CHR), a rulebased language to specify application-oriented constraint solvers, into the declarative multiparadigm language Curry. This integration provides a convenient way to specify and use flexible constraint systems in applications implemented in Curry. We propose to represent CHR as data objects in Curry programs so that the ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1999